import { Body, Controller, Get, HttpStatus, Param, Post } from '@nestjs/common';
import { TreePersonService } from '@/modules/tree-person/tree-person.service';
import { ApiBody, ApiResponse, ApiTags } from '@nestjs/swagger';
import { TreePerson } from './tree-person.entity';

@ApiTags('人员分类')
@Controller('tree-person')
export class TreePersonController {
  constructor(private readonly treePersonService: TreePersonService) {}
  @ApiBody({
    description: '请求体',
    type: TreePerson,
  })
  @Post()
  postData(@Body() body) {
    return this.treePersonService.createTest(body);
  }

  @ApiResponse({ status: HttpStatus.OK, description: '请求成功' })
  @Get()
  getAll(@Param() param) {
    return this.treePersonService.getAll(param);
  }
}
